#!/usr/bin/env python
#! -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django.db import models

# Create your models here.


class footer_url(models.Model):
    title = models.CharField(u'底部页签名称', blank=True, max_length=10)
    url = models.CharField(u'页签跳转地址', blank=True, max_length=10)
    key_id = models.IntegerField(u'展示序号', blank=False, default=0)

    publish_date = models.DateField(auto_now_add=True, blank=True)
    latest_date = models.DateField(auto_now=True, blank=True)

    def __unicode__(self):  # 在Python3中用 __str__ 代替 __unicode__
        return self.title

    class Meta:
        verbose_name = '底部页签'
        verbose_name_plural = '底部页签'
        ordering = ['key_id']


class common_admin(admin.ModelAdmin):
    class Media:
        js = (
            '/media/js/jquery-1.8.3.min.js',
            '/media/js/jquery.form.js',
            # '/media/js/django_ajax.js',
            '/media/js/tinymce/tinymce.min.js',
            '/media/js/textareas.js',
        )
